import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [{
    path: '/',
    redirect: '/dashboard'
  },
  {
    path: '/login',
    component: () => import('@/views/Login.vue')
  },
  {
    path: '/dashboard',
    component: () => import('@/views/Dashboard.vue'),
    children: [{
      path: 'welcome',
      component: () => import('@/views/dashboard/Welcome.vue')
    },
    {
      path: 'user',
      component: () => import('@/views/user/User.vue'),
      children: [{
        path: 'index',
        component: () => import('@/views/user/Index.vue'),
      }]
    },
    {
      path: 'film',
      component: () => import('@/views/film/Film.vue'),
      children: [{
        path: 'index',
        component: () => import('@/views/film/Index.vue'),
      }]
    },
    {
      path: 'cinema',
      component: () => import('@/views/cinema/Cinema.vue'),
      children: [{
        path: 'index',
        component: () => import('@/views/cinema/Index.vue'),
      }]
    },
    {
      path: 'college',
      component: () => import('@/views/college/College.vue'),
      children: [{
        path: 'index',
        component: () => import('@/views/college/Index.vue'),
      }]
    },
  ]
  }
  ]
})

export default router
